<?php
                    
set_magic_quotes_runtime(0);

function strips(&$el) {
  if (is_array($el))
    foreach($el as $k=>$v)
      strips($el[$k]);
  else $el = stripslashes($el);
}
if (get_magic_quotes_gpc()) {
  strips($_GET);
  strips($_POST);
  strips($_COOKIE);
  strips($_REQUEST);
  if (isset($_SERVER['PHP_AUTH_USER'])) strips($_SERVER['PHP_AUTH_USER']);
  if (isset($_SERVER['PHP_AUTH_PW']))   strips($_SERVER['PHP_AUTH_PW']);
}
                    
if(!defined('PATH_SEPARATOR'))
    define('PATH_SEPARATOR', ';');
                                   
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../app/'));
set_include_path(
    APPLICATION_PATH . '/../libs' 
    . PATH_SEPARATOR . get_include_path()
);

define('DATA_PATH', APPLICATION_PATH . '../data/');

require_once "Zend/Loader.php";
require_once "API/Loader.php";
Zend_Loader::registerAutoload('API_Loader');
                  
//"C:\\WORX\\cSharp_projects\\billing\\BillingSystem\\sqlite_db\\billing.db"                  
                  
$config = new Zend_Config(
    array(
        'database' => array(
            'adapter' => 'Oracle', //*/'Pdo_Sqlite',
            'params' => array(           
                //'dbname' => 'C:\WORX\JAVA\JDWN\jdwn.db',
                'host' => 'localhost',
                'port' => '1521',
                'dbname' => 'XE',
                'username' => 'billing',
                'password' => 'billing',
            )
        )
    )
);

//define("OCI_COMMIT_ON_SUCCESS", true);

$db = Zend_Db::factory($config->database);  
//$db->query("SET NAMES utf8");
$sess = new Zend_Session_Namespace('Default');
Zend_Registry::set('db', $db);
Zend_Registry::set('sess', $sess);

unset($db, $sess, $config);